home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 5.0 KB | 160 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWSelect.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWSELECT_H
- #define FWSELECT_H
-
- #ifndef FWPRTDEF_H
- #include "FWPrtDef.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef FWODTYPS_H
- #include "FWODTyps.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class ODStorageUnit;
- class ODStorageUnitView;
- class ODFacet;
- class ODShape;
- class ODSession;
-
- class FW_CPart;
- class FW_CFrame;
- class FW_CPresentation;
- class FW_CCloneInfo;
- class FW_CPromise;
- class FW_CPoint;
- class FW_CMouseEvent;
- class FW_CLinkSource;
- class FW_CContent;
- class FW_CLinkDestination;
- class FW_CString;
-
- //========================================================================================
- // constants
- //========================================================================================
-
- extern const ODPropertyName FW_kPropFrameInfo; // = "Framework:Property:FrameInfo";
-
- //========================================================================================
- // class FW_CSelection
- //========================================================================================
-
- class FW_CSelection
- {
- public:
- FW_DECLARE_AUTO(FW_CSelection)
-
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- FW_CSelection(Environment* ev, FW_Boolean allowLinkSource, FW_Boolean allowLink);
- virtual ~FW_CSelection();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- virtual FW_Boolean IsEmpty(Environment* ev) const = 0;
- virtual void SelectAll(Environment* ev) = 0;
- virtual void ClearSelection(Environment* ev) = 0;
- virtual void CloseSelection(Environment* ev) = 0;
- virtual FW_CContent* GetSelectedContent(Environment* ev) = 0;
-
- // ----- Linking -----
- virtual FW_Boolean IsSelectionLinkable(Environment* ev);
- virtual FW_Boolean CanPasteAsLink(Environment* ev,
- ODPasteAsMergeSetting& setting,
- ODStorageUnit* su);
-
- virtual FW_CLinkSource* DoFindLinkSource(Environment* ev);
-
- virtual FW_CLinkDestination* GetLinkDestination(Environment* ev, FW_Boolean& multipleLinks);
- FW_Boolean CanEditSelection(Environment* ev, FW_CFrame* frame);
-
- // ----- Selection region and hit testing -----
- virtual FW_Boolean IsMouseInDraggableItem(Environment* ev,
- FW_CFrame* frame,
- const FW_CMouseEvent& theMouseEvent,
- FW_Boolean inBackground);
- virtual ODShape* AcquireSelectionOutline(Environment* ev,
- ODFacet* facet,
- FW_CFrame* frame);
- virtual ODShape* AcquireSelectionShape(Environment* ev,
- ODFacet* facet,
- FW_CFrame* frame);
-
- virtual void UpdateSelectionOnMouseDown(Environment* ev,
- const FW_CMouseEvent& mouseEvent,
- ODFacet* embeddedFacet,
- FW_Boolean inEmbeddedFrameBorder,
- FW_Boolean inBackground);
-
- // ----- Selection Info -----
- virtual FW_Boolean GetSelectionInfoString(Environment* ev, FW_CString& infoString);
- virtual FW_Handled ShowSelectionInfo(Environment* ev);
-
- // ----- Getters/Setters -----
- FW_CPresentation* GetPresentation(Environment* ev) const;
- FW_CPart* GetPart(Environment* ev) const;
-
- //----------------------------------------------------------------------------------------
- // For Internal Use Only
- //
- public:
- void PrivSetPresentation(FW_CPresentation* presentation);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
- FW_CPresentation* fPresentation;
- FW_Boolean fAllowLinkSource;
- FW_Boolean fAllowLink;
- };
-
- //========================================================================================
- // FW_CSelection Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CSelection::GetPresentation
- //----------------------------------------------------------------------------------------
- inline FW_CPresentation* FW_CSelection::GetPresentation(Environment*) const
- {
- return fPresentation;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSelection::PrivSetPresentation
- //----------------------------------------------------------------------------------------
- inline void FW_CSelection::PrivSetPresentation(FW_CPresentation* presentation)
- {
- fPresentation = presentation;
- }
-
- #endif
-